﻿@{
    ViewBag.Title = "积分换购记录";
    Layout = "~/Areas/WeiXinAreas/Views/Shared/_LayoutWeui.cshtml";
}
<style>
    .con1 {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .content {
        width: 50%;
        float: left;
    }

    .money {
        color: #fdcb07;
        height: 2rem;
        font-size: 0.8rem;
    }

    .time {
        font-size: .7rem;
        color: #666;
    }

    .state {
        height: 2rem;
        font-size: .7rem;
        text-align: right;
    }

    .sh {
        color: #FF0000;
    }

    .wc {
        color: #00ff00;
    }

    .yj {
        color: #fdcb07;
    }
</style>
<div class="weui-cells"  style="margin-top:0rem">
    @*<div class="weui-cell">
        <div class="weui-cell__bd">
            <div>
                <div class="content">
                    <div class="money">¥583.00</div>
                    <div class="time">2017.12.21 14:20</div>
                </div>
                <div class="content">
                    <div class="state">等待中</div>
                    <div class="time" style=" text-align:right;">2017.12.21 15:20</div>
                </div>
            </div>
        </div>
    </div>*@
</div>
<div class="weui-loadmore" id="divMore">
    <i class="weui-loading"></i>
    <span class="weui-loadmore__tips">正在加载...</span>
</div>
<div style="height:60px;"></div>
<div class="weui-tabbar" style="position:fixed;">
    <a href="~/WeiXinAreas/Main/Index" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/home@2x.png" alt="">
        </div>
        <p class="weui-tabbar__label">首页</p>
    </a>
    <a href="~/WeiXinAreas/Main/NewsList" class="weui-tabbar__item">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/kecheng@2x.png" alt="">
        </div>
        <p class="weui-tabbar__label">新闻</p>
    </a>
    <a href="~/WeiXinAreas/Main/Ponser" class="weui-tabbar__item  weui-bar__item--on">
        <div class="weui-tabbar__icon">
            <img src="~/Content/M/img/person@2x_.png" alt="">
        </div>
        <p class="weui-tabbar__label">个人</p>
    </a>
</div>
@section footScript
{
    <script type="text/javascript">
        //上拉加载更多
        var loading = false;  //状态标记
        var _page = 1;
        $(document).ready(function () {
            initMoreData();
            $(document.body).infinite().on("infinite", function () {
                if (loading) return;
                loading = true;
                setTimeout(function () {
                    _page++;
                    initMoreData();
                }, 1000);
            });
        });
        function initMoreData() {
            $.ajax({
                url: "getMoreHG?pagenum=" + _page,
                dataType: 'json',
                type: 'post',
                success: function (_data) {
                    loading = false;
                    var _html = '';

                    for (var i = 0, len = _data.length; i < len; i++) {
                        var record = _data[i];
                        _html += '<div class="weui-cell"><div class="weui-cell__bd"> <div><div class="content">';
                        _html += '<div class="money">' + record.F_JLIntegral + '</div>';
                        _html += ' <div class="time">' + record.F_CreateTime + '</div> </div>';
                        _html += ' <div class="content">';
                        
                        _html += record.F_Integral + '</div>';
                        _html += '</div></div></div></div>';
                    }
                    $(".weui-cells").append(_html);
                    if (_data.length < 10) {
                        $(".weui-cells").after('  <div class="weui-footer" style="margin:1rem">--已经到底了--</div>');
                        $(document.body).destroyInfinite();
                        $("#divMore").hide();
                    }
                }
            });
        }
    </script>
}
